from itertools import islice
from digits import digits
from continuedfraction import cfvalues, cfe
             
for (n,d) in islice(cfvalues(cfe()), 100):
    print sum(digits(n))